import { HashRouter as Router, Route, Redirect, Switch } from 'react-router-dom'
import Layout from './pages/Layout'
import CityList from './pages/CityList'
import Map from './pages/Map'
import Detail from './pages/HouseDetail'
import Login from './pages/Login'
import Favorite from './pages/Favorite'
import AutoRoute from './components/AutoRoute'
import Rent from './pages/Rent'
import RentAdd from './pages/Rent/Add'
import RentSearch from './pages/Rent/Search'

function App() {
  return (
    <Router>
      <div className="App">
        <Switch>
          <Redirect exact from="/" to="/layout"></Redirect>
          <Route path="/layout" component={Layout}></Route>
          <Route path="/citylist" component={CityList}></Route>
          <Route path="/map" component={Map}></Route>
          <Route path="/detail/:id" component={Detail}></Route>
          <Route path="/login" component={Login}></Route>
          <AutoRoute path="/favorate" component={Favorite}></AutoRoute>
          <AutoRoute exact path="/rent" component={Rent}></AutoRoute>
          <AutoRoute path="/rent/add" component={RentAdd}></AutoRoute>
          <AutoRoute path="/rent/search" component={RentSearch}></AutoRoute>
        </Switch>
      </div>
    </Router>
  )
}

export default App
